//
//  GuestManagerTableViewCell.m
//  QRMaster
//
//  Created by myApple on 15/4/13.
//  Copyright (c) 2015年 myApple. All rights reserved.
//

#import "GuestManagerTableViewCell.h"
#import "UIImageView+WebCache.h"
#import "chooseColor.h"

@interface GuestManagerTableViewCell()
{
    UILabel * nameLabel;
    UIImageView * titleImgView;
}

@end

@implementation GuestManagerTableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        [self prepareView];
    }
    return self;
}

-(void)prepareView
{
    float x = 16;
    float y = 9;
    float width = 38;
    float height = 38;
    
    titleImgView = [[UIImageView alloc]initWithFrame:CGRectMake(x, y, width, height)];
    titleImgView.layer.cornerRadius = 19;
    titleImgView.layer.masksToBounds = YES;
    [self.contentView addSubview:titleImgView];
    
    
    x = 72;
    y = (56 - 20) / 2.0;
    width = UI_SCREEN_WIDTH - x - 20;
    height = 20;
    nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(x, y, width, height)];
    nameLabel.font = [UIFont systemFontOfSize:16.0];
    nameLabel.textColor = UIColorFromRGB(0x333333);
    [self.contentView addSubview:nameLabel];
    
}

-(void)setGuestName:(NSString *)guestName
{
    _guestName = guestName;
    nameLabel.text = guestName;
}

-(void)setHeadUrl:(NSString *)headUrl
{
    _headUrl = headUrl;
    NSString * url = [NSString stringWithFormat:@"%@%@",YSBHEADERIMGURL,_headUrl];
    [titleImgView sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:[UIImage imageNamed:@"ic_加载头像212"]];
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
